﻿using System;
using System.Collections.Generic;

namespace ShadeTree.Binding
{
    public interface IScreenBinder : IEnumerable<IScreenElement>, IScreenDriver
    {
        bool IsLatched { get; }
        void AddElement(IScreenElement element);
        void SetDefaultValues();
        void UpdateScreen();
        void Validate(IBoundScreenElement element);

        void BindToModel(object target);
        bool ApplyChangesToModel();
        void ResetToOriginalValues();
        void MessageElements(Action<IScreenElement> action);
        void InsideLatch(Action action);

        Action OnChange { get; set;}

        void MakeReadOnly(bool readOnly);
    }
}